require('module-alias/register')
var { v4  } = require ('uuid');



var uuid = function (req, res, next) {
    var uuid = v4()
    if(req.cookies["uuid"]){
        res.status(200).send({data:req.cookies.uuid,code:200})
        return 
    }else{
        res.cookie('uuid', uuid, { signed: false});
        res.send({data:uuid,code:200})
    }
}
module.exports = { uuid };